package com.example.rbacmanage.controller.system;

import com.example.rbacmanage.common.Result;
import com.example.rbacmanage.entity.system.OperLog;
import com.example.rbacmanage.service.system.OperLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/system/operlog")
public class OperLogController {
    @Autowired
    private OperLogService operLogService;
    @GetMapping("/list")
    public Result getOperLogList(OperLog operLog) {
        return Result.success(operLogService.getPage(operLog));
    }
    @PostMapping("/save")
    public Result save() {
        operLogService.save(new OperLog());
        return Result.success();
    }
    @GetMapping("/get/{id}")
    public Result getOperLogById(@PathVariable Long id) {
        return Result.success(operLogService.getById(id));
    }

    @PostMapping("/remove")
    public Result remove(@RequestBody Long[] ids)  {
        operLogService.remove(ids);
        return Result.success();
    }

    @PostMapping("/update")
    public Result update() {
        operLogService.update(new OperLog());
        return Result.success();
    }
}
